package com.abel.bigwater.data.kente

import com.abel.bigwater.data.BcdString
import com.alibaba.fastjson.JSON
import io.netty.buffer.Unpooled
import org.junit.Assert.assertEquals
import org.junit.Test
import org.slf4j.LoggerFactory

class KenteWaitCommTest {
    @Test
    fun testParse() {
        val buf = Unpooled.buffer().apply {
            writeBytes(BcdString.toByteArray("57 41 49 54 43 4f 4d 4d 2c 47 50 52 53 49 44 3d 32 30 31 30 36 31 31 30 2c"))
        }

        val list = KenteWaitComm.parse(buf)
        assertEquals(1, list?.count())
        lgr.info(JSON.toJSONString(list))
    }

    companion object {
        private val lgr = LoggerFactory.getLogger(KenteWaitCommTest::class.java)
    }
}